$OpenBSD: patch-ifmcstat_c,v 1.3 2013/11/25 14:38:28 sthen Exp $
--- ifmcstat.c.orig	Tue Jul 21 09:47:07 2009
+++ ifmcstat.c	Thu Nov 21 16:38:11 2013
@@ -40,7 +40,7 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <net/if.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(__OpenBSD__)
 # include <net/if_var.h>
 #endif
 #include <net/if_types.h>
@@ -50,14 +50,25 @@
 # ifdef	__FreeBSD__
 #  define	KERNEL
 # endif
+# ifdef __OpenBSD__
+#  define	_KERNEL
+# endif
 # include <netinet/if_ether.h>
 # ifdef	__FreeBSD__
 #  undef	KERNEL
 # endif
+# ifdef __OpenBSD__
+#  undef	_KERNEL
+# endif
 #else
 # include <net/if_ether.h>
 #endif
 #include <netinet/in_var.h>
+#ifdef __OpenBSD__
+# define	_KERNEL
+# include <netinet6/in6_var.h>
+# undef		_KERNEL
+#endif
 #include <arpa/inet.h>
 
 #include <netdb.h>
@@ -85,7 +96,7 @@ void if6_addrlist __P((struct ifaddr *));
 void in6_multilist __P((struct in6_multi *));
 struct in6_multi * in6_multientry __P((struct in6_multi *));
 
-#if !defined(__NetBSD__) && !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(__OpenBSD__)
+#if !defined(__NetBSD__) && !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
 #ifdef __bsdi__
 struct ether_addr {
 	u_int8_t ether_addr_octet[6];
@@ -369,7 +380,7 @@ in6_multilist(mc)
 		mc = in6_multientry(mc);
 }
 
-#if !defined(__NetBSD__) && !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(__OpenBSD__)
+#if !defined(__NetBSD__) && !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
 static char *
 ether_ntoa(e)
 	struct ether_addr *e;
